package cn.k.qo;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.util.StringUtils;

import java.util.Date;

@Setter
@Getter
public class BusinessQueryObject extends QueryObject {
    private String name;
    private String scope;
    private String tel;
    private String legalName;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public String getName(){
        //判断字符串是否有内容 (即不能为null 和 "")
        //if (name!=null && !"".equals(name))
        return StringUtils.hasText(name)?name:null;
    }

}
